
#ifndef _TTG_SERVICES_SERVICESETTINGS_
#define _TTG_SERVICES_SERVICESETTINGS_
#include "Common/Definitions.h"

#include "Common/Structures.h"

namespace ttg_internal
{
	namespace services
	{
		//Class, that stores to and loads from string settings for specific service.
		class ServiceSettings :public ttg::structures::NamedObject
		{
			private:
				bool enabled;		//should this service be started or not.
			protected:
				//Creates settings, that just starts services.
				inline ServiceSettings(const char *name)
					:ttg::structures::NamedObject(name)
				{ enabled = true; }
				//Returns true, if service should be started.
				inline bool isEnabled() const
				{ return enabled; }
				//Sets or clears "enabled" flag.
				inline void setEnabled(bool value)
				{ enabled = value; }
			public:
				//Returns string, that represents settings for the target service.
				virtual std::string serialize()
				{ return enabled ? getStringName() : std::string(); };
				//For descendants only.
				virtual ~ServiceSettings()
				{ /*nothing*/ }
		};
	}
}

#endif
